/***********************************************************************

 Copyright (c) 2009, Luke Malcolm, www.lukemalcolm.com

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 ***********************************************************************/

#ifndef OFXSMSSQLITE_H
#define OFXSMSSQLITE_H

#include "ofMain.h"
#include "ofxSMS.h"
#include "ofxSQLiteHeaders.h"
#include "ofxSMSsqliteSaveThread.h"
#include "ofxSMSsqliteUtils.h"

class ofxSMSsqlite
{
    public:

        ofxSMSsqlite();
        virtual ~ofxSMSsqlite();

        ofxSMSsqliteSaveThread saveThread;

        bool        save(string filename, ofxSMS * smsObject);

        void        setAutoSave(string filename, ofxSMS * smsObject, float seconds);
        bool        load(string filename, ofxSMS * smsObject);

        bool        exportToFile(string dbFilename, string exportFilename);
        ofxSQLite*  sqlite;

    protected:
        void        autoSave(ofEventArgs &e);

    private:

        ofxTimer	autoSaveTimer;

        string      autoSaveFilename;
        ofxSMS *    autoSaveSMSObject;
};



#endif // OFXSMSSQLITE_H
